//
//  BLVerticalButton.m
//  百思不得姐
//
//  Created by hbl on 16/3/18.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLVerticalButton.h"

@implementation BLVerticalButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
         self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:15];
    }
    return self;
}

- (void)awakeFromNib
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.width);
    
    CGFloat titleY = self.imageView.frame.size.height;
    CGFloat titleH = self.frame.size.height - self.imageView.frame.size.height;
    self.titleLabel.frame = CGRectMake(0, titleY + 5, self.frame.size.width, titleH);
}

@end
